Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / Geometric Styles Reference
Functions / Getting and Setting Patterns


GXSetShapePattern

You can use the GXSetShapePattern function to change the pattern information for a style object associated with a particular shape.

void GXSetShapePattern(gxShape target, 
                       const gxPatternRecord *pattern);
target
A reference to the shape whose pattern information you want to change.
pattern
A pointer to the new pattern information.
DESCRIPTION
The GXSetShapePattern function replaces the pattern information in the style object of the shape specified by the target parameter with the pattern information provided by the pattern parameter. You use the gxPatternRecord structure to provide pattern information.

Passing nil for the pattern parameter indicates that you want no pattern and QuickDraw GX removes any pattern information from the target shape.

If the target shape shares its style object with other shapes, this function makes a copy of the style object, sets the target shape to reference the copy, and changes the pattern property of the copy. (However, if the effect of this function would leave the pattern information unchanged, this function does not create a copy of the style object; instead, it returns a notice).

ERRORS, WARNINGS, AND NOTICES
Errors
out_of_memory
shape_is_nil
parameter_out_of_range
pattern_lattice_out_of_range
Notices (debugging version)
pattern_already_set
SEE ALSO
For a discussion of patterns, see "Patterns" on page 3-31.

For examples of adding patterns to shapes, see page 3-86 through page 3-91.

For a discussion of the gxPatternRecord structure and a description of what types of shapes you can use as pattern shapes, see "The Pattern Structure" on page 3-106.

To retrieve pattern information from a style object, use the GXGetStylePattern function, which is described on page 3-142. To specify pattern information for a style object, use the GXSetStylePattern function, which is described on page 3-144.

To retrieve pattern information from a style object associated with a particular shape, use the GXGetShapePattern function, which is described on page 3-145.

To determine where pattern shapes are drawn for a particular shape, use the GXGetShapePatternPositions function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help